<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMessageTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('message', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->comment('标题')->nullable();
            $table->tinyInteger('type')->comment('类型 群发1,私发2');
            $table->integer('admin_id')->comment('发布人管理员id');
            $table->integer('member_id')->nullable()->comment('私发 用户id');
            $table->tinyInteger('status')->default('0')->comment('回复状态 0未回复 1回复');
            $table->text('content')->comment('发布的内容');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('message');
    }
}
